src := $(wildcard *.c)
obj := $(src:%.c=%.o)
dep := $(src:%.c=.%.o.cmd)

curl: $(obj)
	gcc -o $@ $(obj) -lpthread -lcurl 

-include $(dep)

$(dep):.%.o.cmd:%.c
	@rm $@ -f;
	@gcc -M $< | sed 's/^\(.*\):/$@ \1:/' > $@;

clean:
	rm $(obj) $(dep) curl -rf

install:
	@./install-sh
